package com.zyx.mapper;

import com.zyx.pojo.DTO.PeopleDTO;
import com.zyx.pojo.People;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zyx
 * @since 2021-09-08
 */
public interface PeopleMapper extends BaseMapper<People> {
    @Select("SELECT p_people.`id`,p_people.`people_id`,p_people.`people_name`,p_people.`people_sex`,\n" +
            "p_department.`department_name`,p_people.`people_position`,p_people.`people_phone`,p_people.`people_idCard`,IF(p_people.`people_state`=0,'离职','在职') AS people_state\n" +
            "FROM p_people,p_department\n" +
            "WHERE p_department.`department_id`=p_people.`department_id`")
    List<PeopleDTO> getPeopleList();
}
